package mybatis.test;

import mybatis.MyBatisUtils;
import mybatis.mapper.StudentMapper;
import mybatis.pojo.Student;
import org.apache.ibatis.session.SqlSession;

public class updateStudent {
    public static void main(String[] args) {
        SqlSession sqlSession = MyBatisUtils.getSession();
        StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);
        Student student = studentMapper.findById(1);
        student.setName("ikun11");
        studentMapper.updateStudent(student);
        sqlSession.commit();
        sqlSession.close();
    }
}
